home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il_c / ilPolyWarp.z / ilPolyWarp
Encoding:
Text File  |  2002-10-03  |  10.4 KB  |  265 lines

  1.  
  2.  
  3.  
  4. iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))      IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp - two-dimensional 7-th degree warp
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      ilWarp
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <il/ilCdefs.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      ilPolyWarp manages a two-dimensional n-th degree warp, where 1 <= n <= 7.
  19.  
  20.      AAAAddddddddrrrreeeessssssss TTTTrrrraaaannnnssssffffoooorrrrmmmmaaaattttiiiioooonnnn
  21.      The output image space is mapped to the input image space with an address
  22.      transform defined by two n-th degree polynomials (one for each spatial
  23.      dimension).  The structure _i_l_P_o_l_y_2_D (declared in <il/ilPolyDef.h>)
  24.      defines the degree and coefficients for both polynomials; the field names
  25.      are:
  26.  
  27.           ilPoly2D xc;
  28.           ilPoly2D yc;
  29.  
  30.  
  31.      The structure ilPoly2D has the following field names:
  32.  
  33.           int degree;
  34.           struct ilPolyCoeff2D c;
  35.  
  36.  
  37.      The _d_e_g_r_e_e field specifies the degree of the warp (one to seven).
  38.  
  39.      The structure ilPolyCoeff2D has the following fields:
  40.  
  41.           con,
  42.           y, x,
  43.           y2, xy, x2,
  44.           y3, xy2, x2y, x3,
  45.           y4, xy3, x2y2, x3y, x4,
  46.           y5, xy4, x2y3, x3y2, x4y, x5,
  47.           y6, xy5, x2y4, x3y3, x4y2, x5y, x6,
  48.           y7, xy6, x2y5, x3y4, x4y3, x5y2, x6y, x7
  49.  
  50.  
  51.      Depending on the degree, not all the fields of _i_l_P_o_l_y_C_o_e_f_f_2_D need to be
  52.      specified.  The seventh-degree address transform is implemented by the
  53.      equations:
  54.  
  55.           I(x) = cx.c.con + cx.c.y*y + cx.c.x*x + cx.c.y2*y^2 +
  56.                  cx.c.xy*x*y + cx.c.x2*x^2 + cx.c.y3*y^3 +
  57.                  cx.c.xy2*x*y^2 + cx.c.x2y*x^2*y + cx.c.x3*x^3 +
  58.                  cx.c.y4*y^4 + cx.c.xy3*x*y^3 + cx.c.x2y2*x^2*y^2 +
  59.                  cx.c.x3y*x^3*y + cx.c.x4*x^4 + cx.c.y5*y^5 +
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))      IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))
  71.  
  72.  
  73.  
  74.                  cx.c.xy4*x*y^4 + cx.c.x2y3*x^2*y^3 + cx.c.x3y2*x^3*y^2 +
  75.                  cx.c.x4y*x^4*y + cx.c.x5*x^5 + cx.c.y6*y^6 +
  76.                  cx.c.xy5*x*y^5 + cx.c.x2y4 + cx.c.x3y3*x^3*y^3 +
  77.                  cx.c.x4y2*x^4*y^2 + cx.c.x5y*x^5*y + cx.c.x6*x^6 +
  78.                  cx.c.y7*y^7 + cx.c.xy6*x*y^6 + cx.c.x2y5*x^2*y^5 +
  79.                  cx.c.x3y4*x^3*y^4 + cx.c.x4y3*x^4*y^3 +
  80.                  cx.c.x5y2*x^5*y^2 + cx.c.x6y*x^6*y + cx.c.x7*x^7
  81.  
  82.           I(y) = cy.c.con + cy.c.y*y + cy.c.x*x + cy.c.y2*y^2 +
  83.                  cy.c.xy*x*y + cy.c.x2*x^2 + cy.c.y3*y^3 +
  84.                  cy.c.xy2*x*y^2 + cy.c.x2y*x^2*y + cy.c.x3*x^3 +
  85.                  cy.c.y4*y^4 + cy.c.xy3*x*y^3 + cy.c.x2y2*x^2*y^2 +
  86.                  cy.c.x3y*x^3*y + cy.c.x4*x^4 + cy.c.y5*y^5 +
  87.                  cy.c.xy4*x*y^4 + cy.c.x2y3*x^2*y^3 + cy.c.x3y2*x^3*y^2 +
  88.                  cy.c.x4y*x^4*y + cy.c.x5*x^5 + cy.c.y6*y^6 +
  89.                  cy.c.xy5*x*y^5 + cy.c.x2y4 + cy.c.x3y3*x^3*y^3 +
  90.                  cy.c.x4y2*x^4*y^2 + cy.c.x5y*x^5*y + cy.c.x6*x^6 +
  91.                  cy.c.y7*y^7 + cy.c.xy6*x*y^6 + cy.c.x2y5*x^2*y^5 +
  92.                  cy.c.x3y4*x^3*y^4 + cy.c.x4y3*x^4*y^3 +
  93.                  cy.c.x5y2*x^5*y^2 + cy.c.x6y*x^6*y + cy.c.x7*x^7
  94.  
  95.  
  96.      where cx and cy are the coefficient vectors for x and y, respectively.
  97.      Once again, depending on the degree, not all the fields of cx and cy need
  98.      to be specified.  This polynomial defines the mapping from output image
  99.      coordinates to input image coordinates, that is, I(x) and I(y) define the
  100.      address in the input image space.
  101.  
  102. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  103.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  104.  
  105.           ilPolyWarp* ilPolyWarpCreate(const ilPoly2D* xCoeff, const ilPoly2D* yCoeff)
  106.           ilPolyWarp* ilPolyWarp1(const ilAffine2D* xCoeff, const ilAffine2D* yCoeff)
  107.           ilPolyWarp* ilPolyWarpDegree(int degree)
  108.           ilPolyWarp* ilPolyWarpAffine(const ilAffineWarp* affine)
  109.  
  110.      GGGGeeeetttt////sssseeeetttt mmmmeeeetttthhhhooooddddssss
  111.  
  112.           void ilPolyWarpInit(ilPolyWarp *obj, const ilPoly2D* xCoeff,
  113.                               const ilPoly2D* yCoeff)
  114.           void ilPolyWarpIlPolyWarp1Init(ilPolyWarp *obj, const ilAffine2D* xCoeff,
  115.                                          const ilAffine2D* yCoeff)
  116.           void ilPolyWarpSetDegree(ilPolyWarp *obj, int degree)
  117.           int ilPolyWarpGetDegree(ilPolyWarp *obj)
  118.           const ilPoly2D* ilPolyWarpGetCoeffX(ilPolyWarp *obj)
  119.           const ilPoly2D* ilPolyWarpGetCoeffY(ilPolyWarp *obj)
  120.  
  121.  
  122. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  123.      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp(((())))
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))      IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))
  137.  
  138.  
  139.  
  140.           ilPolyWarp* ilPolyWarp1(const ilAffine2D* xCoeff, const ilAffine2D* yCoeff)
  141.           ilPolyWarp* ilPolyWarpAffine(const ilAffineWarp* affine)
  142.           ilPolyWarp* ilPolyWarpCreate(const ilPoly2D* xCoeff, const ilPoly2D* yCoeff)
  143.           ilPolyWarp* ilPolyWarpDegree(int degree)
  144.  
  145.  
  146.           Construct and initialize a new ilPolyWarp object.  Convenience
  147.           constructors allow the object to be initialized with affine warp
  148.           coefficients.
  149.  
  150.      ggggeeeettttCCCCooooeeeeffffffffXXXX(((())))
  151.  
  152.           const ilPoly2D& ilPolyWarpGetCoeffX(ilPolyWarp *obj)
  153.  
  154.  
  155.           Return the coefficients for the x warp polynomial.
  156.  
  157.      ggggeeeettttCCCCooooeeeeffffffffYYYY(((())))
  158.  
  159.           const ilPoly2D& ilPolyWarpGetCoeffY(ilPolyWarp *obj)
  160.  
  161.  
  162.           Return the coefficients for the y warp polynomial.
  163.  
  164.      ggggeeeettttDDDDeeeeggggrrrreeeeeeee(((())))
  165.  
  166.           int ilPolyWarpGetDegree(ilPolyWarp *obj)
  167.  
  168.  
  169.           Return the degree of the warp.  It is defined to be the maximum of
  170.           the degrees of the two member polynomials.
  171.  
  172.      iiiinnnniiiitttt(((())))
  173.  
  174.           void ilPolyWarpIlPolyWarp1Init(ilPolyWarp *obj, const ilAffine2D* xCoeff,
  175.                                          const ilAffine2D* yCoeff)
  176.           void ilPolyWarpInit(ilPolyWarp *obj, const ilPoly2D* xCoeff,
  177.                               const ilPoly2D* yCoeff)
  178.  
  179.  
  180.           Initialize the coefficients of the polynomial.  If affine
  181.           coefficients are provided, then the degree is set to one.
  182.           Otherwise, the degree is set to the degree of the passed polynomial
  183.           structures.
  184.  
  185.      sssseeeettttDDDDeeeeggggrrrreeeeeeee(((())))
  186.  
  187.           void ilPolyWarpSetDegree(ilPolyWarp *obj, int degree)
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))      IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll      iiiillllPPPPoooollllyyyyWWWWaaaarrrrpppp((((3333))))
  203.  
  204.  
  205.  
  206.           Set the degree of the polynomial.  This method is usually followed
  207.           by a call to the infer method on ilWarp to determine the polynomial
  208.           coefficients.
  209.  
  210. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  211.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllWWWWaaaarrrrpppp
  212.      ilWarpCompose(), ilWarpCopy(), ilWarpDx(), ilWarpDy(), ilWarpDz(),
  213.      ilWarpEval3D(), ilWarpEval(), ilWarpEvalVector(), ilWarpFindRoot(),
  214.      ilWarpGetBBox2D(), ilWarpGetBBox(), ilWarpIdentity(), ilWarpInfer(),
  215.      ilWarpInvert(), ilWarpMinimumNumberOfTies(), ilWarpX(), ilWarpY(),
  216.      ilWarpZ()
  217.  
  218.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm iiiillllWWWWaaaattttcccchhhheeeeddddOOOObbbbjjjjeeeecccctttt
  219.      addWatchCallback(), doWatchCallbacks(), removeWatchCallback()
  220.  
  221. SSSSEEEEEEEE AAAALLLLSSSSOOOO iiiillllWWWWaaaarrrrpppp,,,, iiiillllAAAAffffffffiiiinnnneeeeWWWWaaaarrrrpppp,,,, iiiillllPPPPoooollllyyyyDDDDeeeeffff....hhhh
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.                                                                         PPPPaaaaggggeeee 4444
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.